package model.factories.environment;

import java.util.Map;
import java.util.Scanner;
import java.util.regex.Pattern;
import model.Interpreter;
import model.SyntaxErrorException;
import model.commands.Command;
import model.commands.environment.ClearStampsCommand;
import model.factories.CommandFactory;


/**
 * A factory used to build ClearStampsCommand objects.
 * 
 * @author Angelica Schwartz
 */
public class ClearStampsCommandFactory extends CommandFactory {

    /**
     * Pattern that matches CLEARSTAMPS command keywords.
     */
    private final Pattern myClearStampsPattern = Pattern.
            compile(getInterpreter().getLanguage().getString("ClearStampsPattern"));

    /**
     * 
     * @param interpreter an interpreter
     */
    public ClearStampsCommandFactory (Interpreter interpreter) {
        super(interpreter);
    }

    @Override
    public Command createCommand (Scanner commandReader,
                                  Map<String, Integer> variables) throws SyntaxErrorException {
        commandReader.next();
        return new ClearStampsCommand();
    }

    @Override
    public Pattern patternToMatch () {
        return myClearStampsPattern;
    }

}
